﻿using System;
using Office = Microsoft.Office.Interop;

namespace Ucto.ToExcelConvertor
{
	public class ExcelSheet : IExcelSheet
	{
		public ExcelSheet(Office.Excel._Worksheet sheet)
		{
			if (sheet == null)
			{
				throw new ArgumentNullException("sheet");
			}

			this.Sheet = sheet;
		}

		protected Office.Excel._Worksheet Sheet { get; private set; }

		public object this[int x, int y]
		{
			get
			{
				return this.Sheet.Cells[ColumnIndex: x, RowIndex: y];
			}
			set
			{
				this.Sheet.Cells[ColumnIndex: x, RowIndex: y] = value;
			}
		}
	}
}
